<template lang="pug">
.list-wrap
  .header
    p 收货地址
  .main
    conentBox(v-for="d in setList", :contentList="d" @onTap="onTap")
  .footer
    button(@click="$router.push('/create-add')") 添加地址
</template>
<script>
import conentBox from "../components/conentBox.vue";
export default {
  data() {
    return {
      setList: null,
    };
  },
  components: {
    conentBox,
  },
  methods:{
    onTap(event){
      console.log(event)
      localStorage.setItem('AddId',event)
      this.$router.push('/addren-ding')
    }
  },
  created() {
    this.$store.commit('setIsShow',false)
    this.$http
      .get("http://192.168.43.168:8082/user/sele-addren")
      .then(({ data }) => {
        this.setList = data;
      })
      .catch((err) => {
        console.log(err);
      });
    console.log(1);
  },
};
</script>
<style lang="sass" scoped>
.list-wrap
  width: 3.75rem
  height: 100vh
  position: relative
  .header
    width: 100%
    height: .42rem
    background: rgb(242,242,242)
    display: flex
    justify-content: center
    align-items: center
    p
      width: 100%
      height: 100%
      text-align: center
      line-height: .42rem
  .main
    padding: .2rem
  .footer
    button
      width: 100%
      height: .54rem
      background: rgb(255,103,0)
      position: absolute
      bottom: 0
      left: 0
      text-align: center
      color: #fff
      font-weight: bold
</style>
